package de.lns.ui.menu;

import de.lns.render.Model;
import de.lns.render.Renderer;
import de.lns.tick.GameState;
import de.lns.tick.Update;

public class Menu implements Update{
	private Label newGame;
	private Label options;
	private Label exit;
	private int height;
	private int width;

	public Menu() {
		height = Renderer.getScreenHeight();
		width = Renderer.getScreenWidth();
		this.newGame = new Label(new Model(newGame, 1), width/4, height/7*5, width/4*2, height/7);
		this.options = new Label(new Model(options, 1), width/4, height/7*3, width/4*2, height/7);
		this.exit = new Label(new Model(exit, 1), width/4, height/7, width/2, height/7);
	}
	
	public void onMouseklick(int x, int y){
		if(x>width/4 && x<width/4*3){
		if(y<exit.getPosY()&y>exit.getHeight()+exit.getPosY()){
			
		}
		if(y<options.getPosY()&y>options.getHeight()+options.getPosY()){
			
		}
		if(y<newGame.getPosY()&y>newGame.getHeight()+newGame.getPosY()){
			GameState.active().activate();
		}
		}
		
		
	}

	@Override
	public void update() {
		int x=input.getMouseX();
		int y=input.getMouseY();
		if(input.getMouseClicked()){
			onMouseklick(input.getMouseX(), input.getMouseY());
			
		}
		
	}
	
}

// new game
// exit
// options